/*
 * Copyright (c) ShaoxiongDu <Shaoxiong.dev@aliyun.com> 2021 all Rights Reserved
 */

package zh.codegym.task.task07.task0721;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

/* 
数组中的最小值和最大值
*/

public class Solution {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        int maximum = Integer.MIN_VALUE;
        int minimum = Integer.MAX_VALUE;
        int[] integers = new int[20];
        //在此编写你的代码
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < 20; i++) {
            integers[i] = scanner.nextInt();
            if (integers[i] > maximum) {
                maximum = integers[i];
            }
            if (integers[i] < minimum) {
                minimum = integers[i];
            }
        }

        System.out.print(maximum + " " + minimum);
    }
}
